const comment=require("../model/comment");
module.exports=function(req,res){
    comment.create({
        date:req.body.date,
        user:req.session.user,
        articel:req.body.id, 
        content:req.body.content
    }).then(err=>{
        if(err){
            res.send({
                code:1,
                message:"评论发表成功"
            });
        }else{
            res.send({
                code:0,
                message:"评论发表失败，请稍后重试"
            });
        }
    });
    
}